from selenium import webdriver
from selenium.webdriver.common.by import By
import os
import time

driver = webdriver.Chrome()
url = 'file:///' + os.path.abspath('html') + '\\radio-checkbox.html'
driver.get(url)

# 单选按钮的操作
time.sleep(2)
driver.find_element(By.ID, 'boy').click()
print(driver.find_element(By.ID, 'boy').is_enabled())

time.sleep(2)
driver.find_element(By.ID, 'girl').click()

# 退出
time.sleep(2)
driver.quit()

# 多选框的操作
time.sleep(2)
form = driver.find_elements(By.TAG_NAME, 'form')[1]
input2 = driver.find_elements(By.TAG_NAME, 'input')

for ipt in input2:
    time.sleep(2)
    ipt.click()

